package com.newsnetwork.api.controller.user;

import com.newsnetwork.grace.result.CommonJSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;


/**
 * @author HuangDekai
 * @date 2022/11/4 22:55
 * @Description: 粉丝管理相关api
 */
@Api(value = "粉丝管理", tags = {"粉丝管理功能相关的Controller"})
@RequestMapping("fans")
public interface MyFansControllerApi {

    @ApiOperation(value = "查询当前用户是否关注该作家", notes = "查询当前用户是否关注该作家", httpMethod = "POST")
    @PostMapping("/isMeFollowThisWriter")
    CommonJSONResult isMeFollowThisWriter(@RequestParam String writerId,
                                         @RequestParam String fanId);


    @ApiOperation(value = "成为粉丝, 关注该作家", notes = "成为粉丝, 关注该作家", httpMethod = "POST")
    @PostMapping("/follow")
    CommonJSONResult follow(@RequestParam String writerId,
                            @RequestParam String fanId);

    @ApiOperation(value = "取消关注", notes = "取消关注该作家", httpMethod = "POST")
    @PostMapping("/unfollow")
    CommonJSONResult unfollow(@RequestParam String writerId,
                              @RequestParam String fanId);

    @ApiOperation(value = "查询我的所有粉丝列表", notes = "查询我的所有粉丝列表", httpMethod = "POST")
    @PostMapping("/queryAll")
    CommonJSONResult queryAll(@ApiParam(name = "writerId", value = "作者id", required = true)
                              @RequestParam String writerId,
                              @ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                              @RequestParam Integer page,
                              @ApiParam(name = "pageSize", value = "分页查询每一页显示的条数", required = false)
                              @RequestParam Integer pageSize);

    @ApiOperation(value = "查询男女粉丝数量", notes = "查询男女粉丝数量", httpMethod = "POST")
    @PostMapping("/queryRatio")
    CommonJSONResult queryRatio(@RequestParam String writerId);

    @ApiOperation(value = "根据地域查询粉丝数量", notes = "根据地域查询粉丝数量", httpMethod = "POST")
    @PostMapping("/queryRatioByRegion")
    CommonJSONResult queryRatioByRegion(@RequestParam String writerId);
}
